﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Abp.Domain.Repositories;
using Abp.Domain.Services;
using Abp.UI;
using FwProject.Core.Distribution;

namespace FwProject.Manager
{
    public class DistributionInfoDetailsManager: IDomainService
    {
        private readonly IRepository<DistributionInfoDetails, Guid> _distributiondetailRepository;
        public DistributionInfoDetailsManager(IRepository<DistributionInfoDetails, Guid> distributiondetailRepository)
        {
            _distributiondetailRepository = distributiondetailRepository;

        }
        /// <summary>
        /// 添加一个配送明细
        /// </summary>
        /// <param name="distributionDetail"></param>
        /// <returns></returns>
        public async Task<Guid> CreateDistributionDetail(DistributionInfoDetails distributionDetail)
        {
            
            return await _distributiondetailRepository.InsertAndGetIdAsync(distributionDetail);
        }
        /// <summary>
        ///修改一个配送明细
        /// </summary>
        /// <param name="distributionDetail"></param>
        /// <returns></returns>
        public async Task UpdateDistributionDetail(DistributionInfoDetails distributionDetail)
        {

            await _distributiondetailRepository.UpdateAsync(distributionDetail);
        }
        /// <summary>
        ///  delete 一个配送明细
        /// </summary>
        /// <param name="distributionDetail"></param>
        /// <returns></returns>
        public async Task DeleteDistributionDetail(DistributionInfoDetails distributionDetail)
        {

            await _distributiondetailRepository.DeleteAsync(distributionDetail);
        }
    }
}
